/*
 * @Description  :
 * @Autor        : guoxi
 * @Date         : 2022-07-29 10:52:59
 * @LastEditors  : Please set LastEditors
 * @LastEditTime : 2022-07-29 10:55:10
 * @FilePath     : \rpms\src\store\modules\project.ts
 */
import { defineStore } from "pinia";
import { store } from "/@/store";

export const useProjectStore = defineStore({
  id: "pure-project",
  state: () => ({
    rightRefresh: "",
    leftRefresh: "",
    isHidden: true,
    changeInfo: null,
    stopInfo: null
  }),
  actions: {
    rightSetting() {
      this.rightRefresh = new Date().getTime();
    },

    leftSetting() {
      this.leftRefresh = new Date().getTime();
    },

    // 控制左侧树结构收缩
    isHiddenSetting() {
      this.isHidden = !this.isHidden;
    },
    setChangeInfo(info) {
      this.changeInfo = info;
    },
    setStop(info) {
      this.stopInfo = info;
    }
  },
  getters: {
    getChangeInfo() {
      return this.changeInfo;
    },
    getStopInfo() {
      return this.stopInfo;
    }
  }
});

export function useProjectStoreHook() {
  return useProjectStore(store);
}
